home *** CD-ROM | disk | FTP | other *** search
- global gPathDelim
-
- on startMovie
- if the quickTimePresent = 0 then
- qtErrorHandler()
- end if
- if pc() then
- set gPathDelim to "\"
- else
- set gPathDelim to ":"
- end if
- if appendHardDrive("source") = 0 then
- appendCdDrive()
- end if
- end
-
- on qtErrorHandler
- if pc() then
- go("qtErrorWin")
- else
- go("qtErrorMac")
- end if
- end
-
- on stopMovieScript
- end
-
- on appendHardDrive aFolder
- set fileList to currentFolder()
- if getPos(fileList, aFolder) then
- append(the searchPath, the pathName & aFolder)
- return 1
- else
- return 0
- end if
- end
-
- on currentFolder aPath
- if voidp(aPath) then
- set currentPath to the pathName
- else
- set currentPath to aPath
- end if
- set fileList to []
- repeat with fileNumber = 1 to the maxinteger
- set fileName to lowercase(getNthFileNameInFolder(currentPath, fileNumber))
- if fileName = EMPTY then
- exit repeat
- end if
- append(fileList, fileName)
- end repeat
- return fileList
- end
-
- on appendCdDrive
- if pc() then
- set cdDriveLetter to CheckDrive("aero32.exe")
- append(the searchPath, cdDriveLetter & "\source\")
- else
- set cdName to "Exploring Aeronautics:"
- if getNthFileNameInFolder(cdName, 1) = EMPTY then
- alert("Could not find the Exploring Aeronautics CD-ROM")
- else
- append(the searchPath, cdName & "source:")
- end if
- end if
- end
-
- on pc
- return the machineType = 256
- end
-
- on CheckDrive weirdfile
- repeat with i = 66 to 90
- set drive to numToChar(i)
- set thisDrive to string(drive & ":\")
- set thisPath to string(drive & ":\" & weirdfile)
- set filesOnDrive to currentFolder(thisDrive)
- if getPos(filesOnDrive, weirdfile) then
- return drive & ":"
- exit
- end if
- end repeat
- alert("Could not find the Exploring Aeronautics CD-ROM")
- end
-
- on lowercase whichString
- set newString to EMPTY
- repeat with x = 1 to length(whichString)
- set thisChar to char x of whichString
- set numOfChar to charToNum(thisChar)
- if (numOfChar >= 65) and (numOfChar <= 90) then
- set thisChar to numToChar(charToNum(thisChar) + 32)
- end if
- set newString to newString & thisChar
- end repeat
- return newString
- end
-